﻿package igz.fleaxy.sql {
	
	import flash.data.SQLConnection;
	import flash.events.SQLEvent;
	import flash.filesystem.File;
	import flash.events.SQLErrorEvent;
	
	/**
	 * @author Intelygenz | www.intelygenz.com
	 * 
	 * Clase Vacía, con código de prueba comentado
	 */
	public class SqlManager {
		/*
		private var _SqlConnection : SQLConnection;

		public function SqlManager() {
			_SqlConnection = new SQLConnection();
		}

		public function $OpenConnection ( p_name:String, f_onOpen:Function, f_onError:Function=null ) : void {
			try {
				_SqlConnection.openAsync( _GetDBFilePath(p_name) );
				_SqlConnection.addEventListener(SQLEvent.OPEN, f_onOpen);
				if ( f_onError != null ) {
					_SqlConnection.addEventListener(SQLErrorEvent.ERROR, f_onError);
				}
			}
			catch ( e:SQLErrorEvent ) {
				trace("igz.fleaxy.sql.SqlManager Error[" + e.error.errorID + "] " + e.error.message);
			}
		}
		
		private function _GetDBFilePath ( p_name:String ) : String {
trace("_GetDBFilePath->"+File.applicationStorageDirectory.resolvePath( p_name + ".db" ))
			return File.applicationStorageDirectory.resolvePath( p_name + ".db" );
		}

		public function $CloseConnection(p_name:String) : void {
			_SqlConnection.close();
		}

		public function $CreateSchema(p_name:String) : void {
			_SqlConnection.loadSchema(
		}

		public function $CreateTable(p_name:String) : void {
			
		}
*/
		/**
		 *
		 * @param	p_schema: Schema Name
		 * @param	p_table: Table Name
		 * @param	p_fieldSettings : { name : ""
		 * 							  , type : ""
		 * 							  ,
		 * 							  ,
		 * 							  ,
		 * 						      }
		 */
		public function $CreateField(p_schema:String, p_table:String, p_fieldSettings:Object) : void {
			
		}

	}
	
}